package com.zhongwang.mms.module.material.model;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

import java.util.Calendar;
import java.util.Date;

/**
 * @description:阶段报表导出类
 * @author: th
 * @time: 2020/7/17 10:44
 */
@Data
public class MatStageReportModel {

    @ExcelProperty(value = "项目编号",index = 0)
    private String odaProCode;
    @ExcelProperty(value = "项目名称",index = 1)
    private String odaProName;
    @ExcelProperty(value = "回货重量",index = 2)
    private Double odaWeight;
    @ExcelIgnore
    private Date startOdrDate;
    @ExcelIgnore
    private Date endOdrDate;

    public void setEndOdrDate(Date endOdrDate) {
        if (endOdrDate != null) {
            Calendar cal = Calendar.getInstance();
            cal.setTime(endOdrDate);
            cal.add(Calendar.DAY_OF_YEAR, +1);
            this.endOdrDate = cal.getTime();
        } else {
            this.endOdrDate = endOdrDate;
        }
    }
}
